home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / lines1 / lines016.jar / lines / Lines.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-04-29  |  1.8 KB  |  37 lines

  1. package lines;
  2.  
  3. import javax.microedition.lcdui.Alert;
  4. import javax.microedition.lcdui.Display;
  5. import javax.microedition.midlet.MIDlet;
  6. import javax.microedition.midlet.MIDletStateChangeException;
  7.  
  8. public class Lines extends MIDlet {
  9.    static final String DIRECTIONS_TEXT = "\nReduce 5 or more balls of the same colour by setting them in a vertical, horizontal or diagonal row. LEFT/RIGHT/UP/DOWN to move the cursor, FIRE to select/deselect and move a ball, GAME_A key to show the score, GAME_B to repaint the board.\nPlease let me know if this game works (or doesn't work) on your device - [support@wapindustrial.com]";
  10.    private LinesCanvas canvas;
  11.    private Alert directions = new Alert("Help");
  12.  
  13.    public Lines() {
  14.       this.directions.setTimeout(-2);
  15.       this.directions.setString("Lines v " + LinesCanvas.getVersion() + "\nReduce 5 or more balls of the same colour by setting them in a vertical, horizontal or diagonal row. LEFT/RIGHT/UP/DOWN to move the cursor, FIRE to select/deselect and move a ball, GAME_A key to show the score, GAME_B to repaint the board.\nPlease let me know if this game works (or doesn't work) on your device - [support@wapindustrial.com]");
  16.       this.canvas = new LinesCanvas(this);
  17.       ExitHookup.hookup(this, this.canvas);
  18.    }
  19.  
  20.    public void destroyApp(boolean var1) throws MIDletStateChangeException {
  21.       this.canvas.destroy();
  22.    }
  23.  
  24.    void help() {
  25.       Display.getDisplay(this).setCurrent(this.directions);
  26.    }
  27.  
  28.    public void pauseApp() {
  29.       this.canvas.pause();
  30.    }
  31.  
  32.    public void startApp() throws MIDletStateChangeException {
  33.       Display.getDisplay(this).setCurrent(this.canvas);
  34.       this.canvas.start();
  35.    }
  36. }
  37.